Assigns a plane to another.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(plane), | intent(out) | :: | x |
The resulting plane. |
||
| type(plane), | intent(in) | :: | y |
The source plane |
Assigns a line to another.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(line), | intent(out) | :: | x |
The resulting line. |
||
| type(line), | intent(in) | :: | y |
The source line |
Tests to see if two vectors are parallel.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:) | :: | x |
The first vector. |
|
| real(kind=real64), | intent(in), | dimension(size(x)) | :: | y |
The second vector. |
|
| real(kind=real64), | intent(in), | optional | :: | tol |
The tolerance to use when testing for parallelism. The default tolerance is 10x machine epsilon. |
Returns true if the vectors are parallel; else, false.
Tests to see if two lines are parallel.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(line), | intent(in) | :: | x |
The first line. |
||
| class(line), | intent(in) | :: | y |
The second line. |
||
| real(kind=real64), | intent(in), | optional | :: | tol |
The tolerance to use when testing for parallelism. The default tolerance is 10x machine epsilon. |
Returns true if the lines are parallel; else, false.
Tests to see if two planes are parallel.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(plane), | intent(in) | :: | x |
The first plane. |
||
| class(plane), | intent(in) | :: | y |
The second plane. |
||
| real(kind=real64), | intent(in), | optional | :: | tol |
The tolerance to use when testing for parallelism. The default tolerance is 10x machine epsilon. |
Returns true if the planes are parallel; else, false.
Constructs a line from two points.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | pt1(3) |
The first point. This point will act as the initial point along the line such that in the equation of the line . |
||
| real(kind=real64), | intent(in) | :: | pt2(3) |
The second point. |
The resulting line.
Constructs a line from the intersection of two planes.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(plane), | intent(in) | :: | p1 |
The first plane. |
||
| class(plane), | intent(in) | :: | p2 |
The second plane. |
The resulting line. NaN's are returned in the event that the two planes are parallel.
Constructs the line that best fits the supplied set of points in a least-squares sense.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | pts |
An N-by-3 matrix where N is at least 2, but typically much larger. |
The resulting line.
Constructs a plane from 3 points. The 3 points must not be colinear.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | pt1(3) |
The first point. |
||
| real(kind=real64), | intent(in) | :: | pt2(3) |
The second point. |
||
| real(kind=real64), | intent(in) | :: | pt3(3) |
The third point. |
The resulting plane.
Constructs a plane from a point which lies on the plane, and a unit vector normal to the plane.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | pt(3) |
The point that lies on the plane. |
||
| real(kind=real64), | intent(in) | :: | nrm(3) |
The normal unit vector. |
The resulting plane.
Constructs the plane that best fits a cloud of points in a least-squares sense.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | pts |
The N-by-3 matrix containing the N points to fit. N must be at least 3, but is typically much larger. |
The resulting plane.
Defines the parametric form of a line .
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=real64), | public | :: | r0(3) |
The coordinates of the initial point . |
|||
| real(kind=real64), | public | :: | v(3) |
The vector defining the orientation of the line. |
| private pure function line_from_2pts (pt1, pt2) | Constructs a line from two points. |
| private pure function line_from_2_planes (p1, p2) | Constructs a line from the intersection of two planes. |
| private pure function line_from_many_points (pts) | Constructs the line that best fits the supplied set of points in a least-squares sense. |
| procedure , public :: evaluate => line_eval Function |
Defines a plane as .
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=real64), | public | :: | a |
The x-component of the plane normal vector. |
|||
| real(kind=real64), | public | :: | b |
The y-component of the plane normal vector. |
|||
| real(kind=real64), | public | :: | c |
The z-component of the plane normal vector. |
|||
| real(kind=real64), | public | :: | d |
The offset from the origin. |
| private pure function plane_from_3pts (pt1, pt2, pt3) | Constructs a plane from 3 points. The 3 points must not be colinear. |
| private pure function plane_from_point_and_normal (pt, nrm) | Constructs a plane from a point which lies on the plane, and a unit vector normal to the plane. |
| private pure function plane_from_many_points (pts) | Constructs the plane that best fits a cloud of points in a least-squares sense. |
| procedure , public :: flip_normal => plane_flip_normal Subroutine |
Tests to see if a point lies on a line.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | pt(3) |
The point. |
||
| class(line), | intent(in) | :: | ln |
The line. |
||
| real(kind=real64), | intent(in), | optional | :: | tol |
The tolerance to use when testing. The default tolerance is 10x machine epsilon. |
Returns true if the point lies on the line; else, false.
Tests to see if a point lies on a plane.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | pt(3) |
The point. |
||
| class(plane), | intent(in) | :: | pln |
The plane. |
||
| real(kind=real64), | intent(in), | optional | :: | tol |
The tolerance to use when testing. The default tolerance is 10x machine epsilon. |
Returns true if the point lies on the plane; else, false.
Gets the line parameter for the point on the line nearest the specified point.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | pt(3) |
The point. |
||
| class(line), | intent(in) | :: | ln |
The line. |
The line parameteric variable defining the location of the point nearest along the line.
Returns the normal vector of a plane.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(plane), | intent(in) | :: | pln |
The plane. |
The normal vector.
Projects a point onto a plane.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | pt(3) |
The point. |
||
| class(plane), | intent(in) | :: | pln |
The plane onto which to project the point. |
The projected point.
Computes the shortest distance between a point and a line.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | pt(3) |
The point. |
||
| class(line), | intent(in) | :: | ln |
The line. |
The shortest distance between the point and line.
Computes the shortest distance between a point and a plane.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | pt(3) |
The point. |
||
| class(plane), | intent(in) | :: | pln |
The plane. |
The shortest distance between the point and plane.
Projects a vector onto a plane.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | x(3) |
The vector to project. |
||
| class(plane), | intent(in) | :: | pln |
The plane onto which to project the vector. |
The projected vector.